package com.example.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
 * 库存表
 *
 * @author wy
 * @since 2024-07-17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("inventory")
@ApiModel("库存表")
public class Inventory implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "物资编号")
    private Integer materialId;

    @TableField(exist = false)
    private String materialName;

    @ApiModelProperty(value = "仓库编号")
    private Integer warehouseId;

    @TableField(exist = false)
    private String warehouseName;

    @ApiModelProperty(value = "库存数量")
    private Integer stockQuantity;

    @ApiModelProperty(value = "是否删除 0：未删除；1：已删除")
    private Integer isDeleted;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "乐观锁字段")
    @Version
    @TableField(value = "version", fill = FieldFill.INSERT)
    private Integer version;

}
